
// =================================================================== 
// class description : 
// =================================================================== 
// File: UserType.cs
// Copyright  @ AC
// History:
// 		2012/7/25  created by 
// 
// =================================================================== 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace InternalManagementSystem.DAO.Models
{
	/// <summary>
	///
	/// </summary>
    public class UserType
	{
		#region Private Variables
		
		private System.Int32 _id;

        private System.String _name = string.Empty;
		
		private System.Int32 _guardLine;
		
		
		#endregion
		
		#region Constructors
		
	    public UserType()
		{
		}
		
		public UserType(System.Int32 id)
		{
			_id = id;
	
		}
		
		public UserType(bool populateDefaultValue) : this()
		{
			if(populateDefaultValue)
			{
				_id = 0;
				_name = string.Empty;
				_guardLine = 0;
			}
		}
		
		public UserType(
			System.Int32 id,
			System.String name,
			System.Int32 guardLine
		)
		{
			_id = id;
			_name = name;
			_guardLine = guardLine;
			
		}
		
		#endregion
		
		#region Properties
		
		public System.Int32 ID
		{
			get {return _id;}
			set {_id = value;}
		}
		
		public System.String Name
		{
			get {return _name;}
			set {_name = value;}
		}
		
		public System.Int32 GuardLine
		{
			get {return _guardLine;}
			set {_guardLine = value;}
		}
		
		#endregion
	}
	
	/// <summary>
	/// 
	/// </summary>
    public class UserTypeCollection : CollectionBase
	{
		public UserType this[int index]
        {
            get
            {
                return ((UserType)(List[index]));
            }
            set
            {
                List[index] = value;
            }
        }

        public void Add(UserType item)
        {
            if ((item == null))
            {
                throw new System.Exception("can't add null into collection");
            }
            else
            {
                try
                {
                    List.Add(item);
                }
                catch (NotSupportedException ex)
                {
                    throw new System.Exception((ex.Message + ex.StackTrace));
                }
            }
        }
	}
}